package com.qf.set.service.impl;

import com.qf.set.domain.TmsRole;
import com.qf.set.mapper.TmsRoleMapper;
import com.qf.set.service.ITmsRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * --- 天道酬勤 ---
 *
 * @author 卢泓光
 * @date 2025/9/3
 * @desc
 */
@Service
public class TmsRoleServiceImpl implements ITmsRoleService {


    @Autowired
    private TmsRoleMapper roleMapper;
    @Override
    public List<TmsRole> roleList(TmsRole tmsRole) {
        return roleMapper.selectRoleList(tmsRole);
    }

    @Override
    public int insertRole(TmsRole tmsRole) {
        return roleMapper.insert(tmsRole);
    }

    @Override
    public int updateRoleStatus(Integer roleId, String status) {
        TmsRole role = new TmsRole();
        role.setRoleId(roleId);
        role.setRoleStatus(status);
        return roleMapper.updateRoleStatus(role);
    }

    @Override
    public int deleteRole(Integer roleId) {
        return roleMapper.deleteById(roleId);
    }

    @Override
    public int updateRole(TmsRole tmsRole) {
        return roleMapper.updateRole(tmsRole);
    }
}